#!/usr/bin/ruby -d

require 'net/smtp'

class Reminder < TaskMgr

  def initialize(subm, subj)
    @submitter = subm
    @subject = subj
    if ENVI == "LIVE"
      $from = "remind@tasks.noneo.is-a-geek.org"
    elsif ENVI == "LIVE"
      $from = "remind@tasks.noneo.is-a-geek.org"
    else
      $from = "remind@tasks.noneo.is-a-geek.org"
      self.send(ADMIN, "Wrong environment in class Reminder")
    end
  end
  
  def send
#   t = [id, submitter, subject, date]
    what  = "From: "        + $from      + "\n"
    what += "To: "          + @submitter + "\n"
    what += "Subject: "     + @subject   + "\n\n"
    what += "Description: " + @subject   + "\n"
    Net::SMTP.start('localhost', 25) do |smtp|
      smtp.send_message(what, $from, @submitter)
    end
  end
end
